<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
%>

<jsp:include page="/comm/header.jsp"></jsp:include>
 <div class="clear"></div>
<!--第1部分开始  --> 
    <div class="wrap1">
    	<div class="blank1"></div>
        
<!--选项卡开始--> 	
<div id="mainTabbox">
 <jsp:include page="../tabboxhead3.jsp"/>
 	<div id="conten">
 		<div class="tab_show" id="con_tabmy_1">
  
<jsp:include page="left.jsp"></jsp:include>
<div class="wrap_left">
	<div class="wrap_m2">
    
	   <div class="wrap_m2_cont">
       
       	<jsp:include page="top.jsp"></jsp:include>
       	 
         <div class="blank1"></div>
             <div class="my04_tt">发起申诉</div>
            
            <div class="my04_cont">
                <div class="my12_cont_box" id="transInfos">
                	<s:if test="totalSize == 0">
                		暂无交易信息
                	</s:if>
                	<s:else>
                    	<ul>
                       	  <li class="t1 tt"><span class="box">名称</span></li> 
                       	  <li class="t2 tt"><span class="box">价格</span></li> 
                       	  <li class="t3 tt"><span class="box">佣金</span></li> 
                       	  <li class="t4 tt"><span class="box">交易时间</span></li> 
                       	  <li class="t5 tt"><span class="box">状态</span></li> 
                          <div class="clear"></div>
                        </ul> 
						<s:iterator value="records">
							<ul class="tt">
								<li class="t1">
									<span class="box">
										<input name="rdo" type="radio" value="<s:property value='orderId' />,<s:property value='productId' />, <s:property value='broker.userid' />" />
										&nbsp;&nbsp;&nbsp;
										<a href="<%=path%>/order.htm?id=<s:property value='orderId' />&userType=1" target="_blank">
											<s:property value="goodsName" />
										</a>
									</span>
								</li>
								<li class='t2'><span class='box'><span class='span18'>￥<s:property value='price' /></span></span></li>
								<li class='t3'><span class='box'><span class='span19'>￥<s:property value='serviceFee' /></span></span></li>
								<li class='t4'><span class='box'><s:date name="startTime" format="yyyy-MM-dd" /></span></li>
								<li class="t5">
									<span class="box">
										<s:if test="state == 0">待支付</s:if>
										<s:elseif test="state == 1">待经纪人发货</s:elseif>
										<s:elseif test="state == 2">待确认收货</s:elseif>
										<s:elseif test="state == 3">交易完成</s:elseif>
										<s:else>交易关闭</s:else>
									</span>
								</li>
							</ul>
						</s:iterator>
						<div class="clear"></div>
					</s:else>
                </div>
                 <!--页码开始-->
		<div class="page_box">
			<div class="pagewrap">
				<div class="page" id="page">
					<s:if test="totalSize > 0">
						<ul>
							<s:if test="superPage == 1">
								<li>首页</li>
								<li>上一页</li>
							</s:if>
							<s:else>
								<s:url id="firstPage" action="initAppeals">
									<s:param name="superPage" value="1" />
								</s:url>
								<s:url id="prevPage" action="initAppeals">
									<s:param name="superPage" value="superPage - 1" />
								</s:url>
								<li><s:a href="%{firstPage}">首页</s:a></li>
								<li><s:a href="%{prevPage}">上一页</s:a></li>
							</s:else>
							<s:iterator value="pageList" status="st">
								<s:if test="pageNumber == '...'">
									<li><s:property value='pageNumber' /></li>
								</s:if>
								<s:elseif test="choose">
									<li class="thisclass"><s:property value='pageNumber' /></li>
								</s:elseif>
								<s:else>
									<s:url id="page#st.index" action="initAppeals">
										<s:param name="superPage" value="pageNumber" />
									</s:url>
									<li><s:a href="%{page#st.index}"><s:property value='pageNumber' /></s:a></li>
								</s:else>
							</s:iterator>
							<s:if test="superPage == totalPage">
								<li>下一页</li>
								<li>末页</li>
							</s:if>
							<s:else>
								<s:url id="nextPage" action="initAppeals">
									<s:param name="superPage" value="superPage+1" />
								</s:url>
								<s:url id="lastPage" action="initAppeals">
									<s:param name="superPage" value="totalPage" />
								</s:url>
								<li><s:a href="%{nextPage}">下一页</s:a></li>
								<li><s:a href="%{lastPage}">末页</s:a></li>
							</s:else>
							<li><span class="pageinfo">共 <strong><s:property value='totalPage' /></strong>页<strong><s:property value='totalSize' /></strong>条
							</span></li>
							<div class="clear"></div>
						</ul>
					</s:if>

				</div>
			</div>

		</div>
		<!--页码结束 -->
            </div>   
		<s:fielderror/>
    	 
          	<div class="blank1"></div>
          		<s:if test="records.size > 0">
           			<s:form id="appealForm" action="appealsUpload" name="appealsUpload" method="post" enctype="multipart/form-data">	
           				<input type="hidden" name="appeal.orderid" id="orderId" />
           				<input type="hidden" name="appeal.canId" id="productId" />
           				<input type="hidden" name="appeal.targetid" id="targetId" />
	            		<div class="my04_cont">
	                		<div class="sbox">
	                			申诉理由&nbsp;<textarea name="appeal.content" cols="80" rows="5" class="input1"></textarea><br />
	            				相关附件&nbsp;<input name="file" class="input5" type="file" />
	            			</div>  
							<div class="but_submit" style="text-align:center;">
								<a id="appeal" href="javascript:void(0);">发起申诉</a>&nbsp;&nbsp;&nbsp;
							</div>
	       	 			</div>  
      				</s:form>  
      			</s:if>
       		</div>
       		
          </div>    
		
		
    
    </div>
</div>
<div class="clear"></div>
        
        <!--内容结束-->

 		</div>
 	
 	</div>
 </div>
<!--选项卡结束-->         
             
      </div>

    </div>

<jsp:include page="/comm/bottom.jsp"></jsp:include>
</body>
</html>


 <script>   
 $(document).ready(function() {
	
	$("#appeal").click(function() {
		var value = $("[name=rdo]:checked").val();
		if (value != null) {
			var array = value.split(",");
			$("#orderId").val(array[0]);
			$("#productId").val(array[1]);
			$("#targetId").val(array[2]);
			$("#appealForm").submit();
		}
		else {
			alert("请选择一条交易记录。");
		}
	});
 });
 </script>  


